package com.reader.cms.service.impl.sys;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.reader.cms.entity.sys.SysMessage;
import com.reader.cms.mapper.sys.SysMessageMapper;
import com.reader.cms.service.sys.ISysMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;

/**
 * @@description  服务实现类
 * @author        jiahaikun
 * @date          2018-09-25
 */
@Service("iSysMessageService")
@Transactional
public class SysMessageServiceImpl extends ServiceImpl<SysMessageMapper, SysMessage> implements ISysMessageService {


@Autowired
private SysMessageMapper sysMessageMapper;

/**
 * @function 多表关联查询
 * @param     currentPage 当前页
 * @param     size 每页显示条数
 * @param     code 消息code
 * @param     message 消息名称
 * @return
 */
    @Transactional(readOnly=true)
    @Override
    public Page<Map<String, Object>> selectListPage(int currentPage, int size, String code, String message) {
            Page<Map<String, Object>> page = new Page<>(currentPage, size);// 当前页，总条数 构造 page 对象
            return page.setRecords(sysMessageMapper.selectListPage(page,code,message));
    }

}